<!--
 * @Author: lsjweiyi 759209794@qq.com
 * @Date: 2023-06-18 11:40:57
 * @LastEditors: lsjweiyi 759209794@qq.com
 * @LastEditTime: 2024-05-12 18:52:27
 * @FilePath: \web-ssg\pages\home\About.vue
 * @Description: 网站整体的导航
-->
<template>
    <div style="padding-left: 5px; padding-right: 5px">
        <n-h1 prefix="bar">图像处理类</n-h1>
        <n-space>
            <div v-for="item in imageMenuList" class="card" @click="navigateTo(getRouterPath(item))">
                <n-h2 style="font-weight: bolder">{{ item.name }}</n-h2>
                <n-p style="color: gray">
                    {{ item.description }}
                </n-p>
            </div>
        </n-space>
    </div>
</template>
<script setup lang="ts">
const homeItem = getHomeMenuItem("");
useHead({
    title: homeItem.name,
});

const getRouterPath = (item: MenuItem) => {
    if (item.key === "index") {
        return "/";
    } else if (item.key === "") {
        return "/" + item.routerName;
    } else if (item.routerName === "") {
        return "/" + item.key;
    } else {
        return "/" + item.key + "/" + item.routerName;
    }
};
</script>
<style lang="scss">
.center {
    flex: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card {
    $color: #eaf3ec;
    width: 250px;
    height: 150px;
    border-radius: 25px;
    background-color: $color;
    padding: 10px;
    box-shadow: 10px 10px 10px darken($color, 20%);
    margin: 10px;

    &:hover {
        background-color: lighten($color, 5%);
        cursor: pointer;
    }

    &:active {
        background-color: darken($color, 20%);
        cursor: pointer;
    }
}
</style>
